<?php

function encodePwd($str) {
    $salt = "ubmr";
    return md5(md5($str.$salt));
}

/**
 * @param $userName
 * @param $password
 * @return bool
 */
function checkLogin($userName,$password){
    if(!$userName){
        return false;
    }
    if(!$password){
        return false;
    }

    $userInfo = Model_Admin_User::instance()->selectByUserName($userName);
    if($userInfo['password'] == self::encodePwd($password)){
        return true;
    }
    return false;
}

